/*
 * =====================================================================================
 *
 *       Filename:  3.fib.c
 *
 *    Description:  fibonacci
 *
 *        Version:  1.0
 *        Created:  10/10/2010 03:55:34 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  bucunzai (), 
 *        Company:  bucunzai.info
 *
 * =====================================================================================
 */

int fib_dw(int n){
    int i = 0;
    int val = 0;
    int nval = 1;

    do {
        int t = val + nval;
        val = nval;
        nval = t;
        i++;
    } while ( i < n );
    return val;
}
